<template>
  <div class="head-wrapper" v-web-min-width>
    <div class="head-title">
      <span>大图</span>
      <span @click="goTo('/')">首页</span>
      <span @click="goTo('/groups')">乐趣论坛</span>
      <span>个人中心</span>
      <span>周边发现</span>
      <span class="head-text">
        <a href="javascript:void(0)" @click="openLoginWindow()">登陆</a>&nbsp;&nbsp;&nbsp;
        <a href="javascript:void(0)">注册</a>
      </span>
    </div>
  </div>
</template>

<script type="text/ecmascript-6">
  import { IS_SHOW_LOGIN_WINDOW } from '../../store/mutation-types'
  export default {
    methods: {
      goTo (url) {
        this.$router.push({path: url})
      },
      openLoginWindow () {
        this.$store.dispatch(IS_SHOW_LOGIN_WINDOW, true) // 如果登陆成功，设置成已登录状态
      }
    }
  }
</script>

<style lang="stylus" rel="stylesheet/stylus">
  @import "../../common/style/common.styl";
  @import "head.styl";
</style>
